package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.DishService;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/dish")
@Api(value = "用户端菜品列表")
public class UserDishController {
    @Autowired
    private DishService dishService;
    @ApiOperation(value = "用户获取菜品列表")
    @GetMapping("/list")
    public Result dishList(Integer categoryId){
        List<DishVO> byCategoryId = dishService.findDishByCategoryId(categoryId);
        return Result.success(byCategoryId);
    }


}
